package ca.etsmtl.logti.log619.lab05.filter;

/**
 * This interface is used to define the necessary methods for a SPAM filter implementation.
 * 
 * @author Maxime Caumartin <maxime.caumartin.1@ens.etsmtl.ca>
 */
public interface EmailFilter
{
	public static byte CANT_SAY = -1;
	/**
	 * Returns a name for the current SPAM filter.
	 * @return The human readable name of the current SPAM filter.
	 */
	public String getFilterName();
	
	/**
	 * Checks the passed Message object if it is SPAM or not, defined from the current implementation.
	 * @param message The MimeMessage object containing a email message.
	 * @return The percentage of certainty that the message is SPAM (CANT_SAY <= x <= 100). CANT_SAY implies that the filter cannot 
	 * 		confirm that the message is SPAM or not, and gives up. The analyzers must take this in account. 
	 */
	public byte checkSpam(javax.mail.internet.MimeMessage message);
	
	/**
	 * Gets the confidence level that should be applied to the filter. This can be used to reduce to fine-tune the merging of multiple filters.
	 * @return The confidence level of this filter.
	 */
	public byte getConfidenceLevel();
	
	/**
	 * Used to activate or disable the filter. If the filter is disabled, than after being loaded, 
	 * the EmailFactory will drop the reference to the Filter.
	 * @return If the filter is enabled or not.
	 */
	public boolean enabled();
}